package net.entelijan.cobean.examples.panels;

import javax.swing.JButton;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

import net.entelijan.cobean.examples.util.ExamplesUtil;
import net.miginfocom.swing.MigLayout;

public class DefaultOrderlistPanel extends JPanel {

	private static final long serialVersionUID = 1L;

	private JList list = new JList();

	private JButton upButton = ExamplesUtil.createIconButton("arrow-up.png");

	private JButton downButton = ExamplesUtil
			.createIconButton("arrow-down.png");

	public DefaultOrderlistPanel() {
		super();
		setLayout(new MigLayout("insets 0 0 0 0", "", ""));
		add(new JScrollPane(list), "w max, h max, cell 0 0, span 1 3");
		add(upButton, "cell 1 0, w 100");
		add(downButton, "cell 1 1, w 100");
		add(new JPanel(), "cell 1 2, h max");
	}

	public JList getList() {
		return list;
	}

	public JButton getUpButton() {
		return upButton;
	}

	public JButton getDownButton() {
		return downButton;
	}

	public static void main(String... args) {
		ExamplesUtil.openInFrame(new DefaultOrderlistPanel());
	}

}
